<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:fbi="http://www.fbifaces.org"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .input-col-m {
                width: 60px;
            }

            .input-col-l {
                width: 80px;
            }

            .input-col-xxl {
                width: 1%;
                text-align: right;
            }

            .col-80 {
            }

            .col-20 {
                width: 5%;
            }
        </style>
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript">
            function actSelect(obj) {
                var pkid = obj.parentNode.parentNode.children[0].innerHTML;
                var sfeature = "dialogwidth:800px; dialogheight:520px;center:yes;help:yes;resizable:no;scroll:yes;status:no";
                var arg = new Object();
                arg.doType = "select";
                arg.pkid = pkid;
                var rtn = dialog("common/actinfoDetl.xhtml?doType=select&amp;pkid=" + pkid, arg, sfeature);
            }
        </script>
    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;">
            <p:messages id="msgs" showDetail="false"/>
            <h:form id="form">
                <div id="header">
                    <p:panel header="账户基本信息查询条件">
                        <h:panelGrid columns="2" cellspacing="5" columnClasses="col-80,col-20">
                            <h:panelGrid columns="4" cellspacing="5"
                                         columnClasses="input-col-m,input-col-l,input-col-m,input-col-l">
                                <h:outputLabel value="账户名称:"/>
                                <h:inputText id="actname" size="30" value="#{actinfoQryAction.actinfo.actname}"/>
                                <h:outputLabel value="账号:"/>
                                <h:inputText id="actno" size="30" value="#{actinfoQryAction.actinfo.actno}"/>
                                <h:outputLabel value="账户类型:"/>
                                <h:inputText id="acttype" size="30" value="#{actinfoQryAction.actinfo.acttype}"/>
                            </h:panelGrid>
                            <h:panelGrid>
                                <p:commandButton id="qrybtn" style="width:80px;" value="查询"
                                                 action="#{actinfoQryAction.onQuery}"
                                                 update="pdt,msgs">
                                </p:commandButton>
                            </h:panelGrid>
                        </h:panelGrid>
                    </p:panel>
                </div>

                <p:ajaxStatus style="height:20px;text-align:center">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>

                <p:dataTable id="pdt" style="width:100%;"
                             dynamic="true"
                             value="#{actinfoQryAction.actinfoList}" var="record"
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             paginator="true" rows="30" paginatorPosition="top"
                             rowsPerPageTemplate="100,50,30,10,5"
                             emptyMessage="数据记录为空...">
                    <f:facet name="footer">
                        <div align="right">
                            <h:commandButton id="btnExport" value="Excel导出">
                                <fbi:DataExporter target="pdt" type="xls" excludeColumns="0,7"
                                                  excludeColumnsWidth="10,25,15,25,10,12"
                                                  titleName="账户数据" fileName="actinfo"/>
                            </h:commandButton>
                        </div>
                    </f:facet>
                    <p:column headerText="pkid" style="display:none">
                        <h:outputText value="#{record.pkid}"/>
                    </p:column>
                    <p:column sortBy="#{record.actname}" filterBy="#{record.actname}"
                              filterMatchMode="contains">
                        <f:facet name="header">账户名称</f:facet>
                        <h:outputText value="#{record.actname}"/>
                    </p:column>
                    <p:column sortBy="#{record.actno}" filterBy="#{record.actno}"
                              filterMatchMode="contains">
                        <f:facet name="header">账号</f:facet>
                        <h:outputText value="#{record.actno}"/>
                    </p:column>
                    <p:column sortBy="#{record.acttype}">
                        <f:facet name="header">账户类型</f:facet>
                        <h:outputText value="#{actinfoQryAction.actType.aliasEnums[record.acttype].title}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">备注</f:facet>
                        <h:outputText value="#{record.remark}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">创建人</f:facet>
                        <h:outputText value="#{record.createdBy}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">创建时间</f:facet>
                        <h:outputText value="#{record.createdDate}">
                            <f:convertDateTime pattern="yyyy-mm-dd"/>
                        </h:outputText>
                    </p:column>
                    <p:column headerText="详细" style="width:50px;text-align:center">
                        <p:commandLink style="color:blue;" value="详细" onclick="actSelect(this)">
                        </p:commandLink>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </ui:define>

</ui:composition>